package com.qf.service.impl;

import com.qf.dao.TakeOutStoreInfoMapper;
import com.qf.pojo.entity.StoreInfo;
import com.qf.pojo.resp.BaseResp;
import com.qf.service.TakeOutStoreInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName TakeOutStoreInfoServiceImpl
 * @Description TODO
 * @Author 16222
 * @Date 2022/9/28 18:01
 * @Version 1.0
 **/
@Service
public class TakeOutStoreInfoServiceImpl implements TakeOutStoreInfoService {
    @Autowired
    TakeOutStoreInfoMapper takeOutStoreInfoMapper;

    @Override
    public BaseResp findAllByClassifyId(int id) {
        List<StoreInfo> allByClassifyId = takeOutStoreInfoMapper.findAllByClassifyId(id);
        return new BaseResp(200,"success", allByClassifyId);
    }

    @Override
    public BaseResp findAllByListId(int id) {
        List<StoreInfo> allByListId = takeOutStoreInfoMapper.findAllByListId(id);
        return new BaseResp(200,"success", allByListId);
    }

    @Override
    public BaseResp findAllStoreByClassifyAndStoreDiscount(int id, String storeDiscount) {
        List<StoreInfo> allStoreByClassifyAndStoreDiscount = takeOutStoreInfoMapper.findAllStoreByClassifyAndStoreDiscount(id, storeDiscount);
        return new BaseResp(200,"success",allStoreByClassifyAndStoreDiscount );
    }
}
